package demo4;

class A {
    public A() {
        func();
    }
    public void func() {
        System.out.println("A.func()");
    }
}
class B extends A {
    private int num = 1;

    public B() {
    }

    @Override
    public void func() {
        System.out.println("B.func() " + num);
    }
}
public class Test {
    public static void main(String[] args) {
        B d = new B();
    }
}
